import json
from sdk.client import Client
from sdk.common import BuildClient

class Charge:
    def __init__(self, client):
        self.client = client

    def charge_start(self, req):
        self.app_id = self.client.app_id
        self.app_secret = self.client.app_secret
        post_params = BuildClient.build_post_param(self,req.__dict__)  # Use self.client to call it
        return self.client.post("/open/charge/start", post_params)

    def charge_stop(self, req):
        self.app_id = self.client.app_id
        self.app_secret = self.client.app_secret
        post_params = BuildClient.build_post_param(self,req.__dict__)  # Same here
        return self.client.post("/open/charge/stop", post_params)